package com.news.news.tesk;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * Created by 罗铠威 on 2023/9/3 12:18
 * type:执行定时任务
 */
@Component
public class TestTask {
//    @Scheduled(cron = "*/6 * * * * ?")/*每六秒执行一次*/
//    private void process() {
//        System.out.println("现在时间:" + new Date());
//    }

   /* @Scheduled(cron = "2-4 * * * * ?")*//*每六秒执行一次*//*
    private void process() {
        System.out.println("现在时间:" + new Date());
    }*/
}
